@import './common.global.less';
@import './antd-fix.global.less';

.inbiz-MemberSelect {
  height: 100%;

  .ant-modal-header {
    padding: 9px 20px !important;
    border-bottom: none;

    .ant-modal-title {
      font-size: 16px !important;

      div {
        color: var(--inbiz-color-text);
      }
    }
  }

  &-dataTable {
    flex: 1;
    overflow: hidden;
    user-select: none;

    &-pagination {
      height: 35px !important;
      line-height: 35px !important;

      .ant-select-selector {
        margin-top: 0 !important;
      }

      >.ant-pagination {
        margin-top: -2px;
      }
    }

    .ant-table {
      font-size: 14px;
    }

    .ant-table-header {
      .ant-table-thead {
        .ant-table-cell {
          padding: 10px;

          &>span {
            color: var(--inbiz-color-heading);
          }
        }
      }
    }

    .ant-table-body {
      overflow-y: auto !important;
      scrollbar-width: thin;
      .scrollbarHover;

      .ant-table-tbody {
        .ant-table-row {
          cursor: pointer;

          .ant-table-cell {
            height: 18px;
            padding: 10px;
            line-height: 18px;

            span {
              color: var(--inbiz-color-heading);
            }
          }

          .ant-table-cell-row-hover {
            background-color: #fafafa;
          }

          &.ant-table-row-selected {
            .ant-table-cell {
              background-color: var(--ant-primary-1);
            }

            .ant-table-cell-row-hover {
              background-color: var(--ant-primary-1);
            }
          }
        }
      }
    }
  }

  .datatable-empty-data {
    .ant-spin-nested-loading {
      height: 100%;

      .ant-spin-container {
        height: 100%;

        .ant-table-empty {
          height: 100%;

          .ant-table-container {
            height: 100%;

            .ant-table-body {
              height: 100%;

              table {
                height: 100%;
              }
            }
          }
        }
      }
    }

    .ant-table-tbody {
      tr {
        td {
          border: none;
        }
      }
    }
  }

  &-content {
    height: 100%;
    background-color: #fff;
  }

  &-searchBar {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;

    .ant-input-affix-wrapper {
      font-size: 14px;
      line-height: 22px;
      border-radius: 4px;

      &:focus {
        &+.ant-input-suffix {
          display: flex;
        }
      }
    }

    .ant-checkbox-wrapper {
      font-size: 14px;

      .ant-checkbox {
        font-size: 14px;
      }
    }
  }

  &-uniqueSearchBar {
    margin: 10px 0 10px 8px;

    .ant-input-affix-wrapper {
      font-size: 14px;
      line-height: 22px;
      border-radius: 4px;
    }
  }

  &-searchCheck {
    margin-left: 6px;
    user-select: none;

    span {
      &:nth-child(2) {
        color: var(--inbiz-color-heading);
      }
    }
  }

  .ant-modal-content {
    overflow: hidden;
    border-radius: 8px;
  }

  .ant-modal-footer {
    border: none;
  }

  .ant-tabs-nav {
    height: 33px;
    line-height: 33px;
    // padding: 0 20px;

    &::before {
      border-color: #ddd;
    }
  }

  .ant-tabs-tab {
    font-size: 14px;

    div.ant-tabs-tab-btn {
      color: var(--inbiz-color-heading);
    }

    &.ant-tabs-tab-active {
      div.ant-tabs-tab-btn {
        color: var(--inbiz-color-primary);
      }
    }
  }

  .ant-modal-body {
    padding: 10px 20px 0;
  }

  // .ant-tabs-content-holder {
  //   padding: 0 20px;
  // }

  &-treeModeWrap {
    height: 100%;
    padding: 10px;
    overflow: auto;
  }

  &-dataList {
    width: 100%;
    overflow: auto;

    .ant-spin-nested-loading {
      height: 100%;

      .ant-spin-container {
        height: 100%;
        scrollbar-width: thin;

        .ant-list-empty-text {
          display: flex;
          align-items: center;
          justify-content: center;
          height: 100%;
        }

        .scrollbarHover,
        .ant-list-items {
          .ant-list-item {
            padding: 0;
            cursor: pointer;

            .ant-radio-wrapper,
            .ant-checkbox-wrapper {
              align-items: center;

              svg {
                display: block;
              }
            }

            &.memberItemSelected {
              background-color: var(--ant-primary-1);

              &:hover {
                .ant-list-item-meta {
                  background-color: var(--ant-primary-1);
                }
              }
            }
          }

          .ant-list-item-meta {
            align-items: center;
            margin: 0;
            padding: 8px;
            user-select: none;

            .ant-list-item-meta-avatar {
              >span {
                display: flex;
                align-items: center;
              }
            }

            .ant-list-item-meta-content {
              h4 {
                color: var(--inbiz-color-heading);
              }
            }

            .ant-radio-wrapper,
            .ant-checkbox-wrapper {

              .ant-radio,
              .ant-checkbox {
                top: 0;
              }

              &::after {
                display: none;
              }
            }

            .ant-checkbox-wrapper {
              align-items: center;
              font-size: 14px;
            }

            .ant-list-item-meta-title {
              margin-bottom: 0;
              font-size: 14px;
            }

            &:hover {
              background-color: #fafafa;
            }
          }
        }

        .ant-list-item-meta-avatar {
          margin-right: 0;
        }
      }
    }
  }

  &-modalFooter {
    padding: 0;
  }

  &-modalFooterContent {
    display: flex;

    .ant-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: auto;
      height: 38px;
      padding: 10px 21px;

      &.ant-btn-default {
        color: var(--inbiz-color-text);

        &:hover {
          color: var(--inbiz-color-primary);
          border-color: var(--inbiz-color-primary);
        }
      }

      &.ant-btn-primary {
        margin-left: 15px !important;
      }

      >span {
        margin: 0;
        letter-spacing: 0;
      }
    }
  }

  &-modalFooterLeft {
    flex: 1;
    text-align: left;
  }

  &-primaryText {
    color: var(--inbiz-color-primary);
  }

  &-selectedCountBtn {
    color: var(--inbiz-color-heading);
    cursor: pointer;
    user-select: none;
  }

  &-tab {
    position: relative;
    min-width: @tabWidth;
    height: 100%;
    margin: 0 auto;
    border: 1px solid #ddd;

    &::after {
      display: block;
      clear: both;
      content: '';
    }

    .ant-checkbox-group {
      .ant-list-item {
        .ant-list-item-meta {
          height: 40px;
        }
      }
    }
  }

  &-selectedOverlayContent {
    font-size: 12px;
    border: none !important;

    .ant-card-bordered {
      border: none;
    }

    .ant-card-body {
      height: 100%;
      padding: 16px 0;
      overflow: auto;
      .scrollbarHover;

      .ant-tag-close-icon {
        display: flex;
        align-items: center;
        justify-content: center;
      }
    }

    .ant-empty {
      user-select: none;
    }
  }

  &-leftTree {
    float: left;
    width: 185px;
    height: 100%;
    overflow: auto;
    overflow: overlay;
    border-right: 1px solid #ddd;
    scrollbar-width: thin;
    .scrollbarHover;

    .ant-tree {
      &.ant-tree-directory {
        .ant-tree-list {
          .ant-tree-list-holder {
            .ant-tree-list-holder-inner {
              .ant-tree-treenode {
                align-items: center;
                height: 32px;
                padding: 0;

                &:hover {
                  &::before {
                    background: #fafafa;
                  }
                }

                &::before {
                  bottom: 0;
                }

                .ant-tree-switcher-noop {
                  position: relative;
                }

                .ant-tree-switcher-noop::before {
                  position: absolute;
                  top: calc(50% - 12px);
                  left: calc(50% - 12px);
                  display: block;
                  width: 8px;
                  height: 8px;
                  margin: 8px 0 0 8px;
                  border: 2px solid #aaa;
                  border-radius: 50%;
                  content: '';
                }

                .ant-tree-switcher {
                  display: flex;
                  align-items: center;
                  justify-content: center;
                  width: 16px;
                  height: 32px;
                  margin-right: 4px;
                  color: #aaa;

                  &>span {
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    width: 16px;
                    height: 16px;

                    &>svg {
                      width: 12px;
                      height: 12px;
                    }
                  }
                }

                .ant-tree-title {
                  color: var(--inbiz-color-heading);
                  font-size: 14px;
                }

                .ant-tree-iconEle {
                  >svg {
                    margin-top: -4px;
                  }
                }
              }

              &>.ant-tree-treenode.ant-tree-treenode-leaf-last:nth-child(1) {
                height: 40px;

                .ant-tree-switcher {
                  height: 40px;
                  margin-left: 4px;
                }
              }

              .ant-tree-treenode-selected {
                width: max-content;
                min-width: 184px;

                .ant-tree-switcher {
                  color: #aaa;
                }

                .ant-tree-title {
                  color: var(--inbiz-color-heading);
                }

                &::before {
                  background: var(--ant-primary-1);
                }

                &:hover {
                  &::before {
                    background: var(--ant-primary-1);
                  }
                }
              }
            }
          }
        }
      }
    }

    &.both {
      .ant-tabs {
        height: 100%;

        .ant-tabs-nav {
          height: 40px;
          margin: 0;
          line-height: 40px;

          .ant-tabs-nav-wrap {
            width: 100%;

            .ant-tabs-nav-list {
              .ant-tabs-tab {
                flex: 1;
              }
            }
          }
        }

        .ant-tabs-content-holder {
          height: calc(100% - 40px);

          .ant-tabs-content {
            height: 100%;

            .ant-tabs-tabpane {
              height: 100%;
              overflow: auto;
            }
          }
        }
      }
    }
  }

  &-rightContent {
    display: flex;
    flex-direction: column;
    float: left;
    width: calc(100% - 185px);
    height: 100%;
    margin: 0 auto;
    overflow: hidden;
  }

  &-tabs {
    position: relative;
    height: 100%;

    .adm-tabs-content {
      position: relative;
      height: calc(100% - 45px);
      padding: 0 var(--content-padding) var(--content-padding);

      >div {
        height: 100%;
      }
    }

    .adm-list {
      .adm-list-item {
        .adm-list-item-content-main {
          flex: 1;
          overflow: hidden;
          white-space: normal;
          word-break: break-all;
        }
      }
    }
  }

  &-hideTabBar {
    .adm-tabs-tab-wrapper {
      display: none;
    }

    &.tabs {
      height: calc(100% - 45px);
    }
  }

  &-selectedCountRow {
    display: flex;
    flex: 0 0 45px;
    align-items: center;
    height: 44px;
    padding: 0 10px;
    line-height: 44px;
    background-color: #fff;
    border-top: none;

    .selectedCountRowLeft {
      flex: 1;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      word-break: break-all;

      .selectAll {
        margin-right: 10px;
        color: var(--inbiz-color-primary);
        font-size: 14px;
      }

      .selected {
        color: #999;
        font-size: 10px;
      }
    }
  }

  &-userTab {
    padding-top: 14px;
  }

  .ant-tree {
    .ant-tree-node-content-wrapper {
      padding: 0 4px 0 0;
      white-space: nowrap;

      .ant-tree-iconEle {
        width: 16px;
        margin-right: 4px;
        padding-top: 3px;
      }

      .ant-tree-title {
        white-space: nowrap;
      }
    }
  }
}

/* *************************************** */

.inbiz-MemberSelectTag.ant-tag {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  max-width: 100%;
  height: 24px;
  margin-right: 8px;
  margin-bottom: 8px;
  padding: 4px 5px 4px 8px;
  overflow: hidden;
  font-size: 12px;
  line-height: 24px;
  background-color: #f8f8f8;
  border: none;
  border-radius: 2px;
  user-select: none;

  >svg {
    width: 16px;
    height: 16px;
    margin-right: 4px;
  }

  >span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;

    &:nth-child(2) {
      color: var(--inbiz-color-heading);
    }
  }

  .ant-tag-close-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: unset;
    margin-left: 5px;
    padding: 0 3px;
    width: 16px;
    height: 16px;

    .anticon {
      color: #ccc;
      font-size: 14px;
      text-align: center;
      border-radius: 50%;
    }

    &:hover {
      .anticon {
        color: #f25b43;
      }
    }
  }
}

.datatable-forbidden-item {
  cursor: not-allowed !important;

  .ant-typography {
    color: rgba(0, 0, 0, 0.45);
  }
}